package com.xk._02算法篇._06greedy.ks;

/**
 * @description:
 * @author: xu
 * @date: 2022/10/17 21:39
 */
public class Article {
    public int weight;
    public int value;
    public double valueDensity; // 价值密度
    public Article(int weight, int value) {
        this.weight = weight;
        this.value = value;
        valueDensity = value * 1.0 / weight;
    }
    @Override
    public String toString() {
        return "Article{" +
                "weight=" + weight +
                ", value=" + value +
                ", valueDensity=" + String.format("%.2f", valueDensity) +
                '}';
    }
}
